class Myvalue{
    public int val;
}
public class Text {
    public static void swap(Myvalue myvalue1,Myvalue myvalue2){
        int tmp=myvalue1.val;
        myvalue1.val=myvalue2.val;
        myvalue2.val=tmp;

    }
    public static void main(String[] args) {
        Myvalue myvalue1=new Myvalue();
        Myvalue myvalue2=new Myvalue();
        myvalue1.val=10;
        myvalue2.val=20;
        System.out.println("交换前:"+myvalue1.val+" "+myvalue2.val);
        swap(myvalue1,myvalue2);
        System.out.println("交换后:"+myvalue1.val+" "+myvalue2.val);
    }
}
